package com.darkteam.jhades.common.message;

import java.io.Serializable;
import java.util.Arrays;

public class RequestMessage implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5374173640659867765L;

	private short function;

	private byte[] paran;
	

	public RequestMessage() {
	}

	public RequestMessage(short function) {
		super();
		this.function = function;
	}

	public RequestMessage(short function, byte[] paran) {
		super();
		this.function = function;
		this.paran = paran;
	}

	public short getFunction() {
		return function;
	}

	public void setFunction(short function) {
		this.function = function;
	}

	public byte[] getParan() {
		return paran;
	}

	public void setParan(byte[] paran) {
		this.paran = paran;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + function;
		result = prime * result + Arrays.hashCode(paran);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RequestMessage other = (RequestMessage) obj;
		if (function != other.function)
			return false;
		if (!Arrays.equals(paran, other.paran))
			return false;
		return true;
	}

}
